home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / others / ole_101.zip / SCHMOO.ZIP / OLEEXIT.C < prev    next >
C/C++ Source or Header  |  1992-04-13  |  1KB  |  51 lines

  1. /*
  2.  * OLEEXIT.C
  3.  *
  4.  * Functions for final OLE cleanup.
  5.  *
  6.  * Copyright(c) Microsoft Corp. 1992 All Rights Reserved
  7.  *
  8.  */
  9.  
  10. #ifdef MAKEOLESERVER
  11.  
  12. #include <windows.h>
  13. #include <ole.h>
  14. #include "schmoo.h"
  15. #include "oleglobl.h"
  16.  
  17.  
  18. /*
  19.  * FOLEExit
  20.  *
  21.  * Purpose:
  22.  *  Handles OLE-server specific shutdown
  23.  *    1.  Free the OLESERVER structure.
  24.  *    2.  Free the procedure instances the server's VTBLs.
  25.  *
  26.  * Parameters:
  27.  *  pOLE            LPXOLEGLOBALS to OLE-specific global variable block.
  28.  *
  29.  * Return Value:
  30.  *  BOOL            FALSE if an error occurred, otherwise TRUE.
  31.  */
  32.  
  33. BOOL FAR PASCAL FOLEExit(LPXOLEGLOBALS pOLE)
  34.     {
  35.     /*
  36.      * Dump the server.  We depend on ServerRelease and DocRelease to
  37.      * clean up documents and objects.  Choosing File/Exit has already
  38.      * revoked the server.  This is simply final cleanup.
  39.      */
  40.     LocalFree(pOLE->pSvr->hMem);
  41.  
  42.     OLEVtblFreeServer  (&pOLE->vtblSvr);
  43.     OLEVtblFreeDocument(&pOLE->vtblDoc);
  44.     OLEVtblFreeObject  (&pOLE->vtblObj);
  45.  
  46.     return TRUE;
  47.     }
  48.  
  49.  
  50. #endif //MAKEOLESERVER
  51.